{$CLEO}

0A95: enable_thread_saving

const
  _delay_attack = 0@
  _vave_count = 1@
  _max_vave = 2@
  _mem_alloc = 3@
  _items_offset = 4@
  _set_items_offset = 5@
  _number_of_members = 6@
  _max_wave = 7@
  _x = 8@
  _y = 9@
  _z = 10@
  _search_actor = 11@
  _get_searh_actor_pedtype_to = 12@
  _get_model_1_to = 13@
  _get_model_2_to = 14@
  _get_model_3_to = 15@
  _get_active_gang_m_id_to = 16@
  _weapon_id = 17@
  _hp_gang = 18@
  _attack_rate = 19@
  _weapon_accuracy = 20@
  _model_id = 21@
  _rand_in_case = 22@
  _actor_model = 23@
  _get_rand_posx = 24@
  _get_rand_posy = 25@
  _r_x = 26@
  _r_y = 27@
  _r_z = 28@
  _actor = 29@
  _get_rand_weapon_id = 30@
  _marker = 31@
  _kill_counter = 0@
end

//This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .CS}

//-------------MAIN---------------
thread 'EXW'
//0AF1: write_int 9 to_ini_file "CLEO\gang_wars_setings" section "the_maximum_amount_of_wave" key "get" 
//0AF1: write_int 60 to_ini_file "CLEO\gang_wars_setings" section "number_of_members" key "get"      
0ADF: add_dynamic_GXT_entry "zov" text "wave ~1~/~1~"
0ADF: add_dynamic_GXT_entry "zog" text "mini game v1.5"
0ADF: add_dynamic_GXT_entry "zomx" text "opponents ~1~/~1~"

var
_vave_count:int
_max_vave:int
_mem_alloc:int
_items_offset:int
_set_items_offset:int
_number_of_members:int
_vave_count:int
_max_wave:int
_number_of_members:int
_kill_counter:int
end
:start
wait 0 
repeat
wait 0
0AF0: _max_wave = get_int_from_ini_file "CLEO\gang_wars_setings" section "the_maximum_amount_of_wave" key "get" 
0AF0: _number_of_members = get_int_from_ini_file "CLEO\gang_wars_setings" section "number_of_members" key "get" 
until if 0ab0: 54
0879: enable_gang_wars 0 
0ACa: show_text_highpriority "~y~~H~enable GANG WARS"
while true
    wait 0 
    if and
       _number_of_members > 10
       100 > _number_of_members
    then
        if and
           _max_wave > 2
           8 > _max_wave
        then break
        else 0ACd: show_text_highpriority "~r~~H~error in the configuration file you exceeded the allowed limit" time 1000
        end
    else 0ACd: show_text_highpriority "~r~~H~error in the configuration file you exceeded the allowed limit" time 1000
    end
end



:repeat 
while true
    repeat
    wait 0 
    until if Player.Defined(0)
    Actor.StorePos($PLAYER_ACTOR, _x, _y, _z)
    if and
        not actor.Driving($PLAYER_ACTOR)
        0AE1: _search_actor = random_actor_near_point _x _y _z in_radius 800.0 find_next 1 pass_deads 0 //IF and SET 
    then
        089F: get_actor _search_actor pedtype_to _get_searh_actor_pedtype_to 
        if _get_searh_actor_pedtype_to == 7
        then
            if and
                051A:   actor _search_actor damaged_by_actor $PLAYER_ACTOR 
                Actor.Dead(_search_actor)
            then
                _get_model_1_to = 102 
                _get_model_2_to = 103 
                _get_model_3_to = 104 
                _get_active_gang_m_id_to = -16711681
                break
            end
        end
        if _get_searh_actor_pedtype_to == 9
        then
            if and
                051A:   actor _search_actor damaged_by_actor $PLAYER_ACTOR 
                Actor.Dead(_search_actor)
            then 
                _get_model_1_to = 108 
                _get_model_2_to = 109 
                _get_model_3_to = 110 
                _get_active_gang_m_id_to = -65281
                break
            end
        end
        if _get_searh_actor_pedtype_to == 14
        then
            if and
                051A:   actor _search_actor damaged_by_actor $PLAYER_ACTOR 
                Actor.Dead(_search_actor)
            then 
                _get_model_1_to = 114 
                _get_model_2_to = 115 
                _get_model_3_to = 116 
                _get_active_gang_m_id_to = 16768190
                break
            end
        end
        if _get_searh_actor_pedtype_to == 11
        then
            if and
                051A:   actor _search_actor damaged_by_actor $PLAYER_ACTOR 
                Actor.Dead(_search_actor)
            then
               _get_model_1_to = 121
               _get_model_2_to = 122
               _get_model_3_to = 123
               _get_active_gang_m_id_to = -1 
               break
            end
        end
        if _get_searh_actor_pedtype_to == 10
        then
            if and
                051A:   actor _search_actor damaged_by_actor $PLAYER_ACTOR 
                Actor.Dead(_search_actor)
            then
               _get_model_1_to = 173     
               _get_model_2_to = 174     
               _get_model_3_to = 175     
               _get_active_gang_m_id_to = 13158600
               break
            end
        end
        if _get_searh_actor_pedtype_to == 13
        then
            if and
                051A:   actor _search_actor damaged_by_actor $PLAYER_ACTOR 
                Actor.Dead(_search_actor)
            then
                _get_model_1_to = 117 
                _get_model_2_to = 118 
                _get_model_3_to = 120 
                _get_active_gang_m_id_to = 0
                break
            end   
        end
        if _get_searh_actor_pedtype_to == 12
        then
            if and
                051A:   actor _search_actor damaged_by_actor $PLAYER_ACTOR 
                Actor.Dead(_search_actor)
            then
                _get_model_1_to = 124
                _get_model_2_to = 125 
                _get_model_3_to = 126 
                _get_active_gang_m_id_to = -1
                break
            end   
        end
    end
    if or
        Actor.Dead($PLAYER_ACTOR)
        $onmission == 1
        0ab0: 55
    then
       :end
       0ACa: show_text_highpriority "~r~~H~gang wars disable"
       goto @start
    end
end
_delay_attack = 0 // licznik
while true
    wait 0
    _delay_attack += 1
    if _delay_attack >= 100
    then break
    end
end

01EB: set_traffic_density_multiplier_to 0.0 
03DE: set_pedestrians_density_multiplier_to 0.0 
//continue 
0ACD: show_text_highpriority "~Y~~H~PROVOCKED GANG WARS GET READY" time 9000 
//---------------------------------------
_set_items_offset = _number_of_members
_set_items_offset *= 4 //[number_of_members] to [set_items_offset] * [4 byte]
_vave_count = 1 //       [wave first]
_weapon_id = 24 //       [first interval weapon id]]
_hp_gang = 100 //        [first interval hp gang]
_attack_rate = 30 //     [first interval attack rate]
_weapon_accuracy = 30 // [first interval gang weapon accuracy]
//----------------------------------------
//continue
01F0: set_max_wanted_level_to 0 //disable cops
// [load 38] [weapon model
for _model_id = 342 to 362 step 1
    if and                                       
        not _model_id == 345                                                                                 
        not _model_id == 354                                                                                 
    then                                                                                               
        Model.Load(_model_id)                                                                                
        038B: load_requested_models                                                                    
    end                                                                                                
end                                  
Model.Load(_get_model_1_to)
Model.Load(_get_model_2_to)
Model.Load(_get_model_3_to)
038B: load_requested_models
 
//succes - action
:next
wait 100
for _items_offset = 0 to _set_items_offset step 4
    wait 0
    0AC6: _mem_alloc = label @get_1 offset
    _mem_alloc += _items_offset 
    0209: _rand_in_case = random_int_in_ranges 1 4                                                              
    if _rand_in_case == 1                                                                                                 
    then 0085: _actor_model = _get_model_1_to // (int)                                                                                              
        else if _rand_in_case == 2                                                                                                        
        then 0085: _actor_model = _get_model_2_to // (int)
            else if _rand_in_case == 3                                                                                                 
            then 0085: _actor_model = _get_model_3_to // (int)
                else if _rand_in_case == 4                                                                                                   
                then 0085: _actor_model = _get_model_3_to // (int)                                                                                                 
                end
            end
        end
    end                                                                                               
    0208: _get_rand_posx = random_float_in_ranges -70.0 70.0                                                       
    0208: _get_rand_posy = random_float_in_ranges 100.0 150.0                                                    
    04C4: store_coords_to _x _y _z from_actor $PLAYER_ACTOR with_offset _get_rand_posx _get_rand_posy 1.0                
    04D3: get_nearest_car_path_coords_from _x _y _z type 2 store_to _r_x _r_y _r_z                    
    _actor = Actor.Create(Gang1, _actor_model, _r_x, _r_y, _r_z)                                                      
    Actor.Angle(_actor) = 88.36082                                                                        
    Actor.Health(_actor) = _hp_gang                                                                            
    0209: _get_rand_weapon_id = random_int_in_ranges 22 _weapon_id                                                            
    Actor.GiveWeaponAndAmmo(_actor, _get_rand_weapon_id, 5000)
    0588: disable_actor _actor validate_position 1 
    wait 10                                                                                           
    _marker = Marker.CreateAboveActor(_actor)                                                                  
    Marker.SetIconSize(_marker, 2)                                                                         
    Marker.SetColor(_marker, _get_active_gang_m_id_to)                                                                          
    07DD: set_actor _actor attack_rate _attack_rate // previously known as temper_to                               
    Actor.WeaponAccuracy(_actor) = _weapon_accuracy                                                                    
    077A: set_actor _actor acquaintance 4 to_actors_pedtype 0 // see ped.dat                              
    05E2: AS_actor _actor kill_actor $PLAYER_ACTOR                                                        
    0A8C: write_memory _mem_alloc size 4 value _actor virtual_protect 0
end

_kill_counter  = 0

while true
    wait 0
    for _items_offset = 0 to _set_items_offset step 4
        wait 0
        03F0: enable_text_draw 0  
        0AC6: _mem_alloc = label @get_1 offset                                                                                    
        _mem_alloc += _items_offset                                                                                                          
        0A8D: _actor = read_memory _mem_alloc size 4 virtual_protect 0                                                                
        if not actor.Dead(_actor)                                             
        then
            else if 056D:   actor _actor defined
            then actor.DestroyInstantly(_actor)                                                                                
                _kill_counter  += 1
            end                                                                                                   
        end
        0AF0: _max_wave = get_int_from_ini_file "CLEO\gang_wars_setings" section "the_maximum_amount_of_wave" key "get" 
        0AF0: _number_of_members = get_int_from_ini_file "CLEO\gang_wars_setings" section "number_of_members" key "get"                                                                                                               
        if _kill_counter  >= _number_of_members //    [kill counter]                                                                                       
        then _kill_counter  = 0 //     [reset kill counter]                                                                                   
            _vave_count += 1 //        [next wave]                                                                                          
            if not _weapon_id >= 38 // [weapon id limit]                                                                            
            then _weapon_id += 2 //    [upgrade weapon id]                                                                             
            end                                                                                                           
            _hp_gang += 18 //          [upgrade hp gang]                                                                                   
            _attack_rate += 10 //      [upgrade attack rate]                                                                               
            _weapon_accuracy += 10 //  [upgrade gang weapon accuracy]                                                                      
            0ACD: show_text_highpriority "~Y~~H~WAIT TO NEXT WAVE" time 9000
            Player.Money(0) += 1000                                                    
            goto @next                                                                                                    
        end                                                                                                               
        if or                                                                                                             
            0741:   actor $PLAYER_ACTOR busted                                                                            
            wasted_or_busted                                                                                              
            Player.Wasted(0)                                                                                              
            $onmission == 1
            0ab0: 55                                                                                               
        then                                                                                                              
            0ACa: show_text_highpriority "~R~~H~SCRIPT UNLOADING"                                      
            goto @clean                                                                                                   
        end
                                                                                                                       
            038E: draw_box_position 90.0 197.0 size 140.0 60.0 RGBA 0 0 0 150                                             
            0340: set_text_draw_RGBA 0 252 252 255                                                                        
            033F: set_text_draw_letter_size 0.3 0.8                                                                       
            033E: set_draw_text_position 23.0 177.0 GXT 'zog'                                                             
            0340: set_text_draw_RGBA 124 252 124 255                                                                      
            033F: set_text_draw_letter_size 0.3 0.8                                                                       
            045B: draw_text_2numbers 23.0 197.0 GXT 'zov' numbers _vave_count _max_wave                                                 
            0340: set_text_draw_RGBA 124 252 124 255                                                                      
            033F: set_text_draw_letter_size 0.3 0.8                                                                       
            045B: draw_text_2numbers 23.0 187.0 GXT "zomx" numbers _kill_counter  _number_of_members                        
                                        
        if _vave_count > _max_wave // (int)                                                                                             
        then                                                                                                              
            01E3: show_text_1number_styled GXT 'M_PASS' number 300000 time 5000 style 1
            Player.Money(0) += 300000                                                                                     
                                                                                                                          
            :clean                                                                                                        
            for _items_offset = 0 to _set_items_offset step 4                                                                                      
                0AC6: _mem_alloc = label @get_1 offset                                                                            
                _mem_alloc += _items_offset                                                                                                  
                0A8D: _actor = read_memory _mem_alloc size 4 virtual_protect 0                                                        
                if 056D:   actor _actor defined                                                                               
                then                                                                                                      
                    Actor.RemoveReferences(_actor)                                                                            
                    actor.DestroyInstantly(_actor)                                                                            
                end                                                                                                       
            end                                                                                                           
            _vave_count = 0                                                                                                       
            01F0: set_max_wanted_level_to 6
            0879: enable_gang_wars 1
            01EB: set_traffic_density_multiplier_to 1.0 
            03DE: set_pedestrians_density_multiplier_to 1.0 
            goto @start                                                                                                   
        end
    end
end

:get_1
hex
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00
end




























 







 





















